import requests
from bs4 import BeautifulSoup

urls = [
    f"https://www.cnblogs.com/#p{page}"
    for page in range(1,10+1)
]

def craw(url):
    r = requests.get(url)
    return r.text

def parser(html):
    soup = BeautifulSoup(html, 'html.parser')
    links = soup.find_all('a', 'post-item-title') # 标签，class
    return [(link['href'], link.get_text()) for link in links]

if __name__ == '__main__':
    for result in parser(craw(urls[2])):
        print(result)




